package com.generator.database.readwriteseparate;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
/**
 * 动态数据源
 * 2018-4-17 19:20:41
 * @author chenjinlong
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
	
	
	@Override
	protected Object determineCurrentLookupKey() {
		//从当前线程获取数据源
		return DynamicDataSourceHolder.getDataSourceKey();
	}
}